#include <iostream>
#include <algorithm>

using namespace std;

string add(string a, string b)
{
    string ret, temp;
    int t, i;
    if (b.size() > a.size())
    {
        temp = a;
        a = b;
        b = temp;
    }
    
    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());

    t = 0;
    for (i = 0; i < a.size(); i++)
    {
        t += a[i] - '0';
        if (i < b.size())
        {
            t += b[i] - '0';
        }
        ret.push_back(t % 10 + '0');
        t /= 10;        
    }

    if (t > 0)
    {
        ret.push_back(t + '0');
    }
    reverse(ret.begin(), ret.end());
    return ret;
}

string adv(string a, string b)
{
    string ret, temp;
    int i, j, t;

    reverse(a.begin(), a.end());
    reverse(b.begin(), b.end());

    ret = "";
    for (i = 0; i < a.size(); i++)
    {
        t = 0;
        temp = "";
        for (j = 0; j < b.size(); j++)
        {   
            t += (a[i] - '0') * (b[j] - '0');
            temp.push_back(t % 10 + '0');
            t /= 10;
        }
        if (t > 0)
        {
            temp.push_back(t + '0');
        }
        reverse(temp.begin(), temp.end());
        for (j = 0; j < i; j++)
        {
            temp.push_back('0');
        }
        ret = add(ret, temp);
    }

    for (i = 0; i < ret.size() && ret[i] == '0'; i++);
    ret = ret.substr(i, ret.size() - i);
    
    if (ret == "")
    {
        ret = "0";
    }
    
    return ret;
}

int main(int argc, char const *argv[])
{
    string result = "0", t = "1", x = "0";
    int n, i;
    cin >> n;
    for (i = 1; i <= n; i++)
    {
        x = add(x, "1");
        t = adv(t, x);
        result = add(t, result);
    }

    cout << result;
    return 0;
}
